/*
  VoIP Wholesale 1.0
  ------------------
  Document   : module_elements.js
  Created on : Sep 14, 2011, 4:16:45 PM
  Author     : Milos Jovanovic <miloscode@gmail.com>
  Description:

 */

// add new entry - external numbering plan
	$(function() {
		$( "#dialog-form" ).dialog({
			autoOpen: false,
			height: 600,
			width: 550,
			modal: true,
			buttons: {
				"Save": function() {					
 
                                    $('#start-date').addClass('ui-state-error');
                                    
				},
				Cancel: function() {
					$( this ).dialog( "close" );
				}
			},
			close: function() {
				allFields.val( "" ).removeClass( "ui-state-error" );
			}
		});
                
// start date for opening dialcodes
$('#date-from').datepick({ 
    defaultDate: minRouteStartDate, selectDefaultDate: true,
    minDate: minRouteStartDate, dateFormat: $.datepick.ISO_8601 ,changeMonth: false});

// end date for opening dialcodes
$('#date-to').click(function(){
    this.blur();
})
$('#date-to').focus(function(){
    this.blur();
})
$('#date-to').select(function(){
    this.blur();
})

$( "#module-save-route" )
			.button()
			.click(function() {	
                                save_new_route();                                
			});



$( "#module-add-new-external" )
			.button()
			.click(function() {
				window.document.location.href = 'add';
			});
       
                
$( "#module-export-xls" )
			.button()
			.click(function() {
				//$( "#dialog-form" ).dialog( "open" );
			});

$( "#module-import-xls" )
			.button()
			.click(function() {
				//$( "#dialog-form" ).dialog( "open" );
			});
        });        